/**
 * Created on 2007-05-23 13:41
 */
package tools.xmlTools;

import org.w3c.dom.Document;

/**
 * @author David Wallin
 * 
 * A wrapper class for xml documents
 */
public class XMLReadOnlyDocument
{
	/**
	 * The file name of this XMLReadOnlyDocument
	 */
	private String					m_DocumentLocation;
	/**
	 * The wrapped xml parser
	 */
	private Document				m_Parser;
	
	/**
	 * Constructor, protected so only XMLTool can call it
	 */
	protected XMLReadOnlyDocument(String documentLocation, Document parser)
	{
		m_DocumentLocation = documentLocation;
		m_Parser = parser;
	}
	
	/**
	 * Gets the file name of this XMLReadOnlyDocument
	 * 
	 * @return the file name of this document
	 */
	public String getDocumentLocation()
	{
		return m_DocumentLocation;
	}
	
	/**
	 * Gets the root node of this xml document
	 * 
	 * @return the root node of this xml document
	 */
	public XMLReadOnlyNode getNode()
	{
		return new XMLReadOnlyNode(m_Parser.getDocumentElement());
	}
}
